<?php

/**
 * Wymaganebadania form base class.
 *
 * @method Wymaganebadania getObject() Returns the current form's model object
 *
 * @package    Rejestracja
 * @subpackage form
 * @author     Michał Sobczak (smichal88@gmail.com)
 */
abstract class BaseWymaganebadaniaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idWymaganeBadania' => new sfWidgetFormInputHidden(),
      'nazwa'             => new sfWidgetFormInputText(),
      'idKontrola'        => new sfWidgetFormPropelChoice(array('model' => 'Kontrola', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'idWymaganeBadania' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdwymaganebadania()), 'empty_value' => $this->getObject()->getIdwymaganebadania(), 'required' => false)),
      'nazwa'             => new sfValidatorString(array('max_length' => 200)),
      'idKontrola'        => new sfValidatorPropelChoice(array('model' => 'Kontrola', 'column' => 'idKontrola')),
    ));

    $this->widgetSchema->setNameFormat('wymaganebadania[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Wymaganebadania';
  }


}
